﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RayTracing
{
    class MultiTexture:Texture,Skin
    {
        public Texture[] texts;
        public Skin[] skins;
        public int sizet;
        public int sizes;

        public MultiTexture(Texture[] texts, Skin[] skins)
        {
            this.texts = texts;
            this.skins = skins;
            sizet = texts.Length;
            sizes = skins.Length;
        }

        public Color textureAt(P2 p)                       
        {
            return texts[p.region % sizet].textureAt(p);                       
        }
        public Color color(P3 point, Ray ray, SceneObject sceneObject)
        {
            int region = sceneObject.geometry.toP2(point).region;
//region % sizes
            return skins[0].color(point, ray, sceneObject);

        }
    }
}
